<template>
	<view class="userteam">
		<view class="no-list" v-if="list.length == 0">
			- 暂无数据 -
		</view>
		<view class="teamlist" v-else>
			<view class="team_item" v-for="(item,index) in list" :key="index">
				<image :src="item.head_url | getImg" v-if="item.head_url" mode=""></image>
				<image src="/static/logo.png" v-else mode=""></image>
				<view class="userinfo">
					<view class="name">
						<view class="text">
							账号：<text>{{item.username || '暂无'}}</text>
						</view>
						<view class="text phone">
							等级：<text class="level">{{item.level_name || '暂无'}}</text>
						</view>
					</view>
					<view class="name ">
						<view class="text">
							姓名：<text>{{item.name || '暂无'}}</text>
						</view>
						<view class="text phone">
							手机号：<text>{{item.phone || '暂无'}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		MyDirect
	} from "@/api/api.js"
	export default {
		data() {
			return {
				page: 1,
				last_page: 1,
				list: []
			}
		},
		onLoad() {
			this.MyDirect()
		},
		methods: {
			MyDirect() {
				MyDirect({
					page: this.page
				}).then(res => {
					if (res.status == 1) {
						this.list = this.list.concat(res.data.data)
						this.last_page = res.data.last_page
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		padding-top: 10px;
		box-sizing: border-box;
	}

	.userteam {

		.teamlist {
			border-radius: 5px;
			margin: 0 auto;
			padding-bottom: 50rpx;

			.team_item {
				display: flex;
				width: 96%;
				padding: 10px;
				box-sizing: border-box;
				border-radius: 5px;
				margin: 0 auto;
				display: flex;
				align-items: center;
				font-size: 14px;
				background: #FFFFFF;
				margin-bottom: 10px;
				box-shadow: 0 0 5px #eee;

				image {
					width: 70px;
					height: 70px;
					margin-right: 20rpx;
				}

				.name {
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin: 5px 0;
					font-size: 12px;
					font-weight: bold;

					.text {
						display: block;
						width: 38%;
						// white-space: nowrap;
						// overflow: hidden;
						// text-overflow: ellipsis;

						text {
							font-weight: normal;
							font-size: 14px;
						}
					}

					.phone {
						width: 72%;
					}

				}

				.userinfo {
					display: flex;
					flex-direction: column;
					flex: 4;
				}

			}
		}
	}
</style>